<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/1/18 0018
  Time: 14:38
  To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>后台日志</title>
    <jsp:include page="/commons/common-js.jsp"></jsp:include>
</head>
<body>
<table class="layui-hide" id="logtable" lay-filter="logtable"></table>

<script type="text/html" id="logtoolbar">
    <div class="layui-form layui-form-pane layui-inline" lay-filter="logform">
        <div class="layui-inline">
            <div class="layui-input-inline" style="width: 80px">
                <select id="searchselect" name="key" style="height: auto">
                    <option value="" selected>全部</option>
                    <option value="0">登录</option>
                    <option value="1">用户操作</option>
                    <option value="2">修改金币</option>
                    <option value="3">控制</option>
                    <option value="4">邮件</option>
                </select>
            </div>
            <div class="layui-input-inline">
                <input type="text" name="value" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-btn-container">
                <button class="layui-btn layui-btn-sm" lay-event="get">查询</button>
            </div>
        </div>
    </div>
</script>

<script>
    layui.use(['table', 'form', 'laytpl'], function () {
        var table = layui.table,
            form = layui.form,
            laytpl = layui.laytpl

        var tableins = table.render({
            elem: '#logtable'
            , url: '/log/all'
            , defaultToolbar: []
            , toolbar: '#logtoolbar'
            , cols: [[
                {type: 'checkbox'}
                ,{field: 'name', width: 90, title: '账号'}
                ,{field: 'thing', width: 800, title: '操作'}
                ,{field: 'ip', width: 160, title: 'ip'}
                ,{field: 'addTime', width: 160, title: '时间'}
            ]]
            , page: true
            , limits: [19, 50, 100]
            , limit: 19
            , height: '820',
        });

        //头工具栏事件
        table.on('toolbar(logtable)', function(obj){
            switch(obj.event){
                case 'get' :
                    var data = form.val("logform")
                    tableins.reload({
                        where:data
                    })
                    form.render()
                    break;
            };
        });

    });

</script>
</body>
</html>
